var vue = new Vue({
    el: "#app",
    data: {
        page: {},
        showPrise: false
    },
    methods: {
        orderChange: function (orderType) {
            var el = event.currentTarget;
            $(".orderBy").closest("div").removeClass("on");
            $(el).closest("div").addClass("on");

            $("#orderType").val(orderType);

            this.commPage(1);

        },
        commPage: function (page) {
            var param = getParams();
            var p = $("#travelForm").serialize() + "&currentPage=" + page;
            //游记分页
            ajaxGet("/travel/query?" + p, {}, function (data) {
                var map = data.data;
                vue.page = map.page;
                buildPage(page, vue.page.totalPages, vue.doPage)
            })
        },
        doPage: function (page) {
            this.commPage(page);
        },
        conditionChange: function () {
            this.commPage(1);
        }
    },
    mounted: function () {
        //游记分页
        ajaxGet("/travel/query", {}, function (data) {
            var map = data.data;
            vue.page = map.page;
            var userInfo = map.userInfo;
            if (userInfo) {
                vue.showPrise = true;
            }
            buildPage(vue.page.number, vue.page.totalPages, vue.doPage)
        })
    }
});

